<?php echo $this->Html->script('Instituicao'); ?>
<?php echo $this->Html->css('upload'); ?>
<div id="msg"></div>
<form action="/siscel/instituicaoLabs/editar" id="INSTITUICAOEditarForm" method="post" enctype="multipart/form-data">
    <fieldset>
        <legend>Unidades</legend>
        <input type="hidden" name="_method" value="POST"/>
        <table width="98%" border="0" cellspacing="0" cellpadding="2">
            <thead>
                <th colspan="3">
                    <b>INFORMAÇÕES BÁSICAS</b>
                </th>
            </thead>
            <tr>
                <td>
                    <?php echo $this->Form->input('InstituicaoLab.NM_INST', array('type' => 'text', 'label' => 'Nome', 'id' => 'txtNome', 'class' => 'campoAlfa', 'size' => "30", 'maxlength' => "100", 'value' => $dados['InstituicaoLab']['NM_INST'] )); ?>
                    <?php echo $this->Form->input('InstituicaoLab.CD_INST_LAB', array('type' => 'hidden', 'id' => 'cdInst', 'value' => $dados['InstituicaoLab']['CD_INST_LAB'] )); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('InstituicaoLab.NM_INST_CURTO', array('type' => 'text', 'label' => 'Nome curto', 'id' => 'txtNomeCurto', 'class' => 'campoAlfa', 'size' => "20", 'maxlength' => "15", 'value' => $dados['InstituicaoLab']['NM_INST_CURTO'] )); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('InstituicaoLab.CD_UPS_SAI_SUS', array('type' => 'text', 'label' => 'CNES', 'id' => 'txtCNES', 'class' => '', 'size' => "5", 'maxlength' => "7", 'value' => $dados['InstituicaoLab']['CD_UPS_SAI_SUS'] )); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php echo $this->Form->input('InstituicaoLab.CNPJ_INST_LAB', array('type' => 'text', 'label' => 'CNPJ', 'id' => 'txtCNPJ', 'class' => 'campoCNPJ', 'size' => "20", 'maxlength' => "18", 'value' => $dados['InstituicaoLab']['CNPJ_INST_LAB'] )); ?>
                </td>
                <td colspan="2">
                    <?php echo $this->Form->input('InstituicaoLab.CD_DIR', array('type' => 'select', 'label' => 'Subordinação', 'id' => 'cdSubordinacao', 'options' => array(''=>'Selecione um item'), 'checked' => $dados['InstituicaoLab']['CD_DIR'] )); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php echo $this->Form->input('InstituicaoLab.DS_EMAIL_PRINCIPAL', array('type' => 'email', 'label' => 'Email principal', 'id' => 'txtEmailPrincipal', 'class' => 'campoEmail', 'size' => "30", 'maxlength' => "120", 'value' => $dados['InstituicaoLab']['DS_EMAIL_PRINCIPAL'] )); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('InstituicaoLab.DS_EMAIL_SECUNDARIO', array('type' => 'email', 'label' => 'Email secundario', 'id' => 'txtEmailSecundario', 'class' => 'campoEmail', 'size' => "30", 'maxlength' => "120", 'value' => $dados['InstituicaoLab']['DS_EMAIL_SECUNDARIO'] )); ?>
                </td>
                <td></td>
            </tr>
            <tr>
                <td style="text-align: right;" colspan="3">
                    <div>
                        <?php
                        if (!empty($dados['InstituicaoLab']['IM_FOTO'])) :
                            echo $this->Siscel->foto($dados['InstituicaoLab']['IM_FOTO']);
                        else:
                            echo $this->Html->image('/img/perfil.jpg', array('width' => '100', 'heigth' => '133', 'label' => null));
                        endif;
                        ?>
                    </div>
                    <div style="float:right">
                        <!-- a href="#upload" class="input upload ">
                            <button type="button">Incluir / Alterar Foto</button -->
                            <?php echo $this->Form->input('InstituicaoLab.fotoUsuario', array('type' => 'file', 'size' => '0', 'style' => 'width: 100px;', 'label' => '', 'class' => '')); ?>
                        <!-- /a -->
                    </div>
                </td>
            </tr>
        </table>
        <div class="submit">
            <input id="btCadastrarIntituicao" type="submit" value="Enviar"/>
        </div>
    </fieldset>
</form>
<script type="text/javascript">
    $(document).ready(function(){
        Instituicao.init();
    });
</script>